<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Evaluation Details</f:facet>


        <s:decorate id="marks" template="layout/display.xhtml">
            <ui:define name="label">Marks</ui:define>
            <h:outputText value="#{evaluationHome.instance.marks}"/>
        </s:decorate>

        <s:decorate id="evalDate" template="layout/display.xhtml">
            <ui:define name="label">Eval date</ui:define>
            <h:outputText value="#{evaluationHome.instance.evalDate}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/EvaluationEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty evaluationFrom ? 'EvaluationList' : evaluationFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Seat</h:panelGroup>
        </f:facet>
    <div class="association" id="seatParent">

        <h:outputText value="There is no seat associated with this evaluation."
                   rendered="#{evaluationHome.instance.seat == null}"/>

        <rich:dataTable var="_seat"
                   value="#{evaluationHome.instance.seat}"
                rendered="#{evaluationHome.instance.seat != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="seatTable">
            <h:column>
                <f:facet name="header">Id seat</f:facet>
                <h:outputText value="#{_seat.idSeat}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Travel id travel</f:facet>
                <h:outputText value="#{_seat.travel.idTravel}"/>
            </h:column>
            <h:column>
                <f:facet name="header">User id user</f:facet>
                <h:outputText value="#{_seat.user.idUser}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Seat number</f:facet>
                <h:outputText value="#{_seat.seatNumber}"/>
            </h:column>
            <h:column>
                <f:facet name="header">State</f:facet>
                <h:outputText value="#{_seat.state}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewseat"
                     value="View"
                      view="/Seat.xhtml">
                    <f:param name="seatIdSeat"
                           value="#{_seat.idSeat}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>User</h:panelGroup>
        </f:facet>
    <div class="association" id="userParent">

        <h:outputText value="There is no user associated with this evaluation."
                   rendered="#{evaluationHome.instance.user == null}"/>

        <rich:dataTable var="_user"
                   value="#{evaluationHome.instance.user}"
                rendered="#{evaluationHome.instance.user != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="userTable">
            <h:column>
                <f:facet name="header">Id user</f:facet>
                <h:outputText value="#{_user.idUser}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Login</f:facet>
                <h:outputText value="#{_user.login}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Password</f:facet>
                <h:outputText value="#{_user.password}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Name</f:facet>
                <h:outputText value="#{_user.name}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Surname</f:facet>
                <h:outputText value="#{_user.surname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Birth date</f:facet>
                <h:outputText value="#{_user.birthDate}">
                    <s:convertDateTime type="date" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Create date</f:facet>
                <h:outputText value="#{_user.createDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Modify date</f:facet>
                <h:outputText value="#{_user.modifyDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Delete date</f:facet>
                <h:outputText value="#{_user.deleteDate}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Type</f:facet>
                <h:outputText value="#{_user.type}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Calculated rate</f:facet>
                <h:outputText value="#{_user.calculatedRate}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Enabled</f:facet>
                <h:outputText value="#{_user.enabled}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewuser"
                     value="View"
                      view="/User.xhtml">
                    <f:param name="userIdUser"
                           value="#{_user.idUser}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
